public class Hw11 {
    public static void main(String[] args) {
        int cock = 5,hen = 3,chick = 1;
        int m = 100,num = 100;

        for(int i = 0;i <= m/cock;i++){
            for(int j = 0;j <= (m-i*cock)/hen;j++){
                    int k = num - i - j;
                    if(i*cock + j*hen + k*chick/3 == m && k%3 == 0){
                        System.out.println(i+"只公鸡"+j+"只母鸡"+k+"只小鸡");
                    }
            }
        }
    }
}

